package com.wyd.singleton;

/**
 * @author Yudi Wang
 * @date 2022/1/27 15:27
 */
public class SingletonC {

    public static SingletonC singletonC;

    private SingletonC(){

    }

    /**
     * 双重检查加锁
     * @return
     */
    public static SingletonC getInstance(){
        if(singletonC == null){
            synchronized (SingletonC.class){
                if(singletonC == null){
                    singletonC = new SingletonC();
                }
            }
        }
        return singletonC;
    }
}
